{%extends "base.html"%}
{%block body%}
<script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
   
	$(document).ready(function(){
		$("#formEdit").validate({
			rules:{
				"title": "required"
			}
		});
		$('#status').val('{{item.status}}');
		$('#parent_id').val('{{item.parent_id}}');
	});
	
	function OnSubmit()
	{
		$('#formEdit').submit();
	}
		
</script>
<table cellpadding="2" width="100%" class="smallfont" border="0">
  <tr>
  	<td class="errorlist" >{{err}}</td>
  </tr>
</table> 
<form name="formEdit" id="formEdit" action="" method="post" onsubmit="OnSubmit();" enctype='multipart/form-data'>
<table border="0" cellpadding="5" cellspacing="0" width=700>
{% if item.image %}
	<tr> <td colspan="2" align="center"><img title="image" width="150" src='/varticle/image/{{item.key.id}}'></td></tr>
{% endif %}
<tr>
	<th width="100">Title*</th>
	<td><input name="title" id="title" type="text" size="50" value="{{item.title}}" ></td>
</tr>
<tr>
	<th>Cate</th>
	<td>
		<select id="parent_id" name="parent_id">
			<option value="">Root</option>
			{% for cate in optionCate.items%}
			<option value="{{cate.1.value}}">{{cate.1.key}}</option>
			{% endfor%}
		</select>
	</td>
</tr>
<tr >
	<th>Status</th>
	<td>
		<select name="status" id="status">
			<option value="0">Hide</option>
			<option value="1">Show</option>
		</select>
 	</td>
</tr>
</table>
<br><br>
<input type="submit" value="Update">
<br><br>
</form>
{%endblock%}